<#include "../common/header.htm">
<div class="content-wrapper">
	<section class="content">
			<div class="box">
				<div class="box-header">
					<div class="row RowSearchWork">
						<div class="col-sm-12">
							<div class="form-group">
								<div class="form-inline">
									<div class="form-group ml10">
										<label>操作时间</label>
										<div class="input-group">
											<input type="text" class="form-control pull-right" name="beginCreateTimeStr" id="starTime" autocomplete="off" placeholder="请输入发起时间" >
											<div class="input-group-addon">
												<span>至</span>
											</div>
											<input type="text" class="form-control pull-right" name="endCreateTimeStr" id="endTime" autocomplete="off" placeholder="请输入结束时间" >
										</div>
									</div>
									<div class="form-group bill-buttonarea" >
										<input type="button" class="btn btn-primary" onclick="datalog.query();" value="查询" />
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div v-show="showType" class="table-responsive">
					<table id="table" class="table text-nowrap"></table>
				</div>
			</div>
	</section>
</div>
<script type="text/javascript">
	/* 日期选择器start */
	$('#starTime').datetimepicker({
	    format: 'yyyy-mm-dd hh:ii',
		language : 'zh-CN',
		autoclose: true,
		todayBtn: true,
		clearBtn : true,
		todayHighlight : true
	}).on('changeDate',function(ev){
	        var starttime=$("#starTime").val();
	        $("#endTime").datetimepicker('setStartDate',starttime);
	        $("#starTime").datetimepicker('hide');
	    });
	$('#endTime').datetimepicker({
	    format: 'yyyy-mm-dd hh:ii',
		language : 'zh-CN',
		autoclose: true,
		todayBtn: true,
		clearBtn : true,
		todayHighlight : true
	}).on('changeDate',function(ev){
		if (ev.date) {
			var endtime=$("#endtime").val();
			$("#starTime").datetimepicker('setEndDate',endtime);
		} else {
			$("#starTime").datetimepicker('setEndDate', new Date());
		}
	    });
	/* 日期选择器end */
	$(function () {
        $('#table').bootstrapTable({
            method : 'post', // 服务器数据的请求方式 get or post
            contentType : "application/x-www-form-urlencoded",
            url:"${ctx}/datalog/importDataList",//请求数据url
            queryParams: function (params) {
                return {
                    pageNumber: (params.offset / params.limit),  //页码
                    pageSize: params.limit,  //页面大小
                };
            },
            striped: true,                      //是否显示行间隔色
            showHeader : true,
            pagination: true,                   //是否显示分页（*）
            sidePagination : 'server',//服务器端分页
            paginationLoop:false,
            resizable:true,
            resizeMode:'flex',
            pageNumber : 1,
            pageSize:30,
            pageList:[30,50,100,150,200],
            //表格的列
            columns: [
                {
                    field: 'FILE_NAME',//域值
                    title: '文件名',//内容
                    visible: true,//false表示不显示
                },
                {
                    field: 'SUCCESS_NUMBER',//域值
                    title: '导入成功条数',//内容
                    visible: true,//false表示不显示
                },
				{
                    field: 'DEAL_FLOW_UUID',//域值
                    title: '数据ID',//内容
                    visible: true,//false表示不显示
                },
				{
                    field: 'TABLE_FLAT',//域值
                    title: '导入标识',//内容
                    visible: true,//false表示不显示
                    formatter: function(value, row, index){
                        if (value==1){
                            return "流水表"
						} else if (value==0) {
                            return "开户信息表"
						}else if (value==2) {
                            return "话单"
						}
                    }
                },
                {
                    field: 'ERROR_NUMBER',//域值
                    title: '导入失败条数',//内容
                    visible: true,//false表示不显示
                    formatter: function(value, row, index){
                        if (value){
                            return value;
                        }
                        return 0;
                    }
                },

                {
                    field: 'accountBody',//域值
                    title: '操作',//内容
                    align:'center',
                    visible: true,//false表示不显示
                    formatter: function(value, row, index){
                        var html='<a href="javascript:void(0)" onclick="deleteFlow(\''+row.DEAL_FLOW_UUID+'\',\''+row.IMPORTDETAILID+'\',\''+row.CASEMANAGE_ID+'\',\''+row.TABLE_FLAT+'\')">删除</a>'
                        return html;
                    }
                }
            ],
            onLoadSuccess: function (result) {
				console.info(result)
            }
        });
    })
    /** 删除导入 **/
    function deleteFlow(dealFlowUuid,importDetailId,caseManagerId,tableFlat){
        $.ajax({
            type : "post",
            url: '${ctx}/datalog/deleteFlow?dealFlowUuid='+dealFlowUuid+'&importDetailId='+importDetailId+'&caseManagerId='+caseManagerId+'&tableFlat='+tableFlat,
            success : function(result) {
                if (result.result == "success") {
                    window.location.reload();
                }
            },
            error : function() {
                toastr.error('删除失败');
            },
        });
    };
	var datalog = {
		query: function () {

		}
	}
</script>
<style>
	label{
		font-weight: 400;
		font-size: 13px;
		color: #6F7689;
	}
	.form-group {
		margin-left: 10px;
		margin-right: 15px;
	}
	.form-control{
		border-radius:4px;
		font-size: 12px;
	}
	.input-group .input-group-addon {
		border-color: transparent;
	}
	.input-group-addon span {
		font-size: 12px;
		color: #6F7689;
	}
	.form-control:focus {
		border-color:#4595ec;
	}
	.form-control:hover{
		border-color:#4595ec;
	}
	.btn-primary{
		background-color:#4595ec;
		border-color:#4595ec;
		width: 70px;
		height: 32px;
	}
	.btn-primary:hover, .btn-primary:active, .btn-primary.hover{
		background-color:#61a8f5;
		border-color:#61a8f5;
	}
	.btn-primary.focus, .btn-primary:focus{
		background-color:#4595ec;
		border-color:#4595ec;
	}
	._overFlowBeanId{
		word-break:keep-all;
		white-space:nowrap;
		overflow:hidden;
		text-overflow:ellipsis;
	}
</style>
<#include "../common/footer.htm">